<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="${pageContext.request.contextPath}/bootstrapStyle/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrapStyle/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrapStyle/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrapStyle/css/animate.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrapStyle/css/style.min.css?v=4.0.0" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/bootstrapStyle/css/jquery-confirm.css"/>
<link href="${pageContext.request.contextPath }/bootstrapStyle/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">

<title>我的信息</title>
</head>
<body>
	<div class="wrapper wrapper-content  animated fadeInRight">
        <div class="row">
        	<div class="clients-list">
        		<ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" href="#stab-1"><i class="fa fa-user"></i>登录信息</a></li>
                    <li class=""><a data-toggle="tab" href="#stab-2"><i class="fa fa-briefcase"></i>医院具体信息</a></li>
                </ul>
                <div class="tab-content">
                	<div id="stab-1" class="tab-pane active">
                		<div class="col-sm-12">
			                <div class="ibox ">
			                    <div class="ibox-content">
			                        <div class="tab-content">
			                            <div id="contact-1" class="tab-pane active">
			                                <div class="ibox-content m-b-sm border-bottom">
				                                <div class="row m-b-lg">
				                                    <div class="col-lg-12 text-center">
				                                        <div class="m-b-sm" align="left">
															<img alt="image" class="img-rounded m-t-xs img-responsive" src="${logininfolist.hosploginpix}" style="width: 120px">  
				                                        </div>
				                                    </div>
				                                    <strong><p>账户当前支付宝账号：<a id="alipayaccount"></a></p></strong>
				                                    <hr/>
				                                    <strong><p>账户当前支付宝姓名：<a id="alipayname"></a></p></strong>
				                                </div>
			                                </div>
			                                <div class="client-detail">
			                                    <div class="full-height-scroll">
			                                        <h2><strong>当前登录信息:</strong></h2>
			                                        <h4>
			                                        <ul class="list-group clear-list">
			                                        	<li class="list-group-item first-item">登录手机号码：<a>${logininfolist.hosploginphone}</a></li>
			                                            <%-- <c:if test="${logininfolist.hosplogintype==1 }"><a style="color: red;" href="${pageContext.request.contextPath}/Main/NoneRegisterMain/myhospitalReg.action">完善个人资料?</a></c:if> --%>
			                                            <li class="list-group-item first-item">当前登录模式:<a id="ZT">${logininfolist.hosplogintypename}</a>&nbsp;&nbsp;</li>
			                                            <%-- <li class="list-group-item first-item" id="TJSH"><c:if test="${logininfolist.hosplogintype==1 }"><a class="btn btn-primary" href="#" onclick="ExamineSubmit()" id="ExamineSubmit">是否提交审核</a></c:if></li> --%>
			                                            <li class="list-group-item first-item">上次登录时间：<a>${logininfolist.hosplogintime}</a></li>
			                                        	<li class="list-group-item first-item"></li><!-- 设置空白，补全上端横线 -->
			                                        </ul>
			                                        </h4>
			                                        <h3><strong>备注</strong></h3>
			                                        <p>备注信息:${logininfolist.examineideas}</p>
			                                    </div>
			                                </div>
			                            </div>
			                        </div>
			                    </div>
			                </div>
			            </div>
                	</div>
                	<div id="stab-2" class="tab-pane">
                		<div class="row">
			            	<div class="col-sm-12 b-r">
			            	<br>
			                	<h2 class="m-t-none m-b">医院具体信息</h2>
			                    <div class="row">
			                    	<div class="col-sm-12">
			                    		<div class="text-center">
						                	<img alt="image" class="img-rounded m-t-xs img-responsive" src="${logininfolist.hosploginpix}" style="width: 120px;">
						                	<br/>
						                </div>
			                    	</div>
			                    	<div class="col-sm-5">
						                <h4>
								            <p><i class="fa fa-user-md"></i> 医院名称：<a>${infolist.hospname }</a></p>
								            <hr/>
							                <p><i class="fa fa-child"></i> 医院联系电话：<a>${infolist.hospphone }</a></p>
								            <hr/>
								            <p><i class="fa fa-intersex"></i> 注册人身份证号码：<a>${infolist.hospregidcard }</a></p>
								            <hr/>
								            <p><i class="fa fa-intersex"></i> 账户审核状态：<a>${logininfolist.hosplogintypename }</a></p>
								            <hr/>
							            </h4>
							        </div>
							        <div class="col-sm-1"></div>
			                        <div class="col-sm-6">
			                        	<h4>
								            <p><i class="fa fa-user"></i> 医院等级：<a>${infolist.hospgrade }</a></p>
								            <hr/>
								            <p><i class="fa fa-birthday-cake"></i> 医院地址1：<a>${infolist.hospadrprovince } | ${infolist.hospadrcity }</a></p>
								            <hr/>
								            <p><i class="fa fa-hospital-o"></i> 医院地址2：<a>${infolist.hospadrarea } | ${infolist.hospadrother }</a></p>
								            <hr/>
							            </h4>
							        </div>
							     	<div class="col-sm-12">
							     		<h4>
								        	<p><i class="fa fa-bank"></i> 医院建院简介：<a>${infolist.hospabs }</a></p>
								        	<hr/>
								        	<p><i class="fa fa-map-marker"></i> 医院特色简介：<a>${infolist.hospfeature }</a></p>
								            <hr/>
							            </h4>
							    	</div>
							    	<hr/>
							    	<div class="col-sm-12">
								    	<div class="panel panel-default">
									    	<div class="panel-heading">
								            	<h5 class="panel-title">
								                	<a data-toggle="collapse" data-parent="#accordion" href="tabs_panels.html#collapseOne">已上传的注册人医师资格证照片*</a>
								            	</h5>
								            </div>
								     		<div id="" class="panel-collapse collapse in">
							                	<div class="panel-body">
							                       	<c:if test="${infolist.hospregdocquacer0!=''}">
														<a class="fancybox" href="${infolist.hospregdocquacer0}" title="图片1">
											            	<img alt="image" src="${infolist.hospregdocquacer0}" style="width:320px;height:180px;"/>
												    	</a>
													</c:if>
													<c:if test="${infolist.hospregdocquacer1!=''}">
												         <a class="fancybox" href="${infolist.hospregdocquacer1}" title="图片2">
												         	<img alt="image" src="${infolist.hospregdocquacer1}" style="width:320px;height:180px;"/>
												         </a>
													</c:if>               
							            		</div>
							            	</div>
							            </div>
							    	</div>
							    	<hr/>
							    	<div class="col-sm-12">
								    	<div class="panel panel-default">
									    	<div class="panel-heading">
								            	<h5 class="panel-title">
								                	<a data-toggle="collapse" data-parent="#accordion" href="tabs_panels.html#collapseOne">已上传的医院代码证照片*</a>
								            	</h5>
								            </div>
								     		<div id="" class="panel-collapse collapse in">
							                	<div class="panel-body">
							                       	<c:if test="${infolist.hosporgcodecer0!=''}">
														<a class="fancybox" href="${infolist.hosporgcodecer0}" title="图片1">
											            	<img alt="image" src="${infolist.hosporgcodecer0}" style="width:320px;height:180px;"/>
												    	</a>
													</c:if>
													<c:if test="${infolist.hosporgcodecer1!=''}">
												         <a class="fancybox" href="${infolist.hosporgcodecer1}" title="图片2">
												         	<img alt="image" src="${infolist.hosporgcodecer1}" style="width:320px;height:180px;"/>
												         </a>
													</c:if>               
							            		</div>
							            	</div>
							            </div>
							    	</div>
							    	<hr/>
							    	<div class="col-sm-12">
								    	<div class="panel panel-default">
									    	<div class="panel-heading">
								            	<h5 class="panel-title">
								                	<a data-toggle="collapse" data-parent="#accordion" href="tabs_panels.html#collapseOne">已上传的注册医院执业许可证*</a>
								            	</h5>
								            </div>
								     		<div id="" class="panel-collapse collapse in">
							                	<div class="panel-body">
							                       	<c:if test="${infolist.hosppraclicense0!=''}">
														<a class="fancybox" href="${infolist.hosppraclicense0}" title="图片1">
											            	<img alt="image" src="${infolist.hosppraclicense0}" style="width:320px;height:180px;"/>
												    	</a>
													</c:if>
													<c:if test="${infolist.hosppraclicense1!=''}">
												         <a class="fancybox" href="${infolist.hosppraclicense1}" title="图片2">
												         	<img alt="image" src="${infolist.hosppraclicense1}" style="width:320px;height:180px;"/>
												         </a>
													</c:if>               
							            		</div>
							            	</div>
							            </div>
							    	</div>
							    	<hr/>
							    	<div class="col-sm-12">
								    	<div class="panel panel-default">
									    	<div class="panel-heading">
								            	<h5 class="panel-title">
								                	<a data-toggle="collapse" data-parent="#accordion" href="tabs_panels.html#collapseOne">已上传的注册医院法人证明照片*</a>
								            	</h5>
								            </div>
								     		<div id="" class="panel-collapse collapse in">
							                	<div class="panel-body">
							                       	<c:if test="${infolist.hosplegalcer0!=''}">
														<a class="fancybox" href="${infolist.hosplegalcer0}" title="图片1">
											            	<img alt="image" src="${infolist.hosplegalcer0}" style="width:320px;height:180px;"/>
												    	</a>
													</c:if>
													<c:if test="${infolist.hosplegalcer1!=''}">
												         <a class="fancybox" href="${infolist.hosplegalcer1}" title="图片2">
												         	<img alt="image" src="${infolist.hosplegalcer1}" style="width:320px;height:180px;"/>
												         </a>
													</c:if>               
							            		</div>
							            	</div>
							            </div>
							    	</div>
			                	</div>
			            	</div>
			        	</div>
                	</div>
        		</div>
        	</div>
    	</div>
    </div>
    <div class="modal inmodal fade" id="bundlingModal" tabindex="-1" role="dialog"  aria-hidden="true">
    	<div class="modal-dialog modal-lg">
        	<div class="modal-content">
            	<div class="modal-header">
                	<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">绑定支付宝</h4>
               	</div>
                <div class="modal-body">
                	<div class="form-group draggable">
						<label class="control-label">支付宝账号*</label>
						<input type="text" min="1" id="Balipayaccount" class="form-control" placeholder="请输入正确的支付宝账号，会影响到您的收入">
					</div>
					<div class="form-group draggable">
						<label class="control-label">支付宝账号对应姓名*</label>
						<input type="text" min="1" id="Balipayname" class="form-control" placeholder="请输入正确的支付宝账号姓名，是您绑定支付宝的姓名">
					</div>
                </div>
				<div class="modal-footer">
                	<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                	<button type="button" class="btn btn-primary" onclick="BalipayaccountSubmit()" id="bundlingModalBtn">提交</button>
           		</div>
           	</div>
        </div>
	</div>
	
	<div class="modal inmodal fade" id="editModal" tabindex="-1" role="dialog"  aria-hidden="true">
    	<div class="modal-dialog modal-lg">
        	<div class="modal-content">
            	<div class="modal-header">
                	<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">修改支付宝</h4>
               	</div>
                <div class="modal-body">
                	<div class="form-group draggable">
						<label class="control-label">支付宝账号*</label>
						<input type="text" min="1" id="Ealipayaccount" class="form-control" placeholder="请输入正确的支付宝账号，会影响到您的收入">
					</div>
					<div class="form-group draggable">
						<label class="control-label">支付宝账号对应姓名*</label>
						<input type="text" min="1" id="Ealipayname" class="form-control" placeholder="请输入正确的支付宝账号姓名，是您绑定支付宝的姓名">
					</div>
                </div>
				<div class="modal-footer">
                	<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                	<button type="button" class="btn btn-primary" onclick="EalipayaccountSubmit()" id="editModalBtn">提交</button>
           		</div>
           	</div>
        </div>
	</div>
    <script src="${pageContext.request.contextPath}/bootstrapStyle/js/jquery.min.js?v=2.1.4"></script>
    <script src="${pageContext.request.contextPath}/bootstrapStyle/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="${pageContext.request.contextPath}/bootstrapStyle/js/plugins/peity/jquery.peity.min.js"></script>
    <script src="${pageContext.request.contextPath}/bootstrapStyle/js/content.min.js?v=1.0.0"></script>
    <script src="${pageContext.request.contextPath}/bootstrapStyle/js/plugins/fancybox/jquery.fancybox.js"></script>
    <script src="${pageContext.request.contextPath }/bootstrapStyle/js/jquery-confirm.js"></script>
    <script src="${pageContext.request.contextPath }/bootstrapStyle/js/plugins/fancybox/jquery.fancybox.js"></script>
    <script>
        $(document).ready(function(){
        	$(".fancybox").fancybox({
        		openEffect:"none",
        		closeEffect:"none"
        	})
       });
       function ExamineSubmit(){
    	   $.confirm({
	   		    title: '提示!',
	   		    content: '是否确认提交审核？提交审核后不可再更改详细信息！',
	   		    type: 'blue',
	   		    typeAnimated: true,
	   		    buttons: {
	   		    	确定: function () {
	   		    		$("#ExamineSubmit").html('<i class="fa fa-spinner fa-spin"></i>处理中...');
    		    		$("#ExamineSubmit").prop('disabled',true);
	   		    		//向服务器发送医院确认提交审核操作！
	   		        	$.ajax({
			    		   type:'post',
			    		   url:"${pageContext.request.contextPath}/Main/NoneRegisterMain/ExamineSubmit.action",
			    		   async: true,
			    		   success:function(data){
			    			   $("#ExamineSubmit").html('是否提交审核');
		    		    	   $("#ExamineSubmit").prop('disabled',false);
			    			   $.alert(data.msg);
			    			   if(data.code=="100"){
			    				   $("#ZT").html("等待审核");
			    				   $("#TJSH").html("");
			    			   }
			    		   },
			    		   error:function(request){
			    			   $.alert("连接失败，检查网络！");
			    			   $("#ExamineSubmit").html('是否提交审核');
		    		    	   $("#ExamineSubmit").prop('disabled',false);
			    		   }
			    	   })
	   		    	},
	   				取消: function () {},
	   		    }	
   			});
       }
    $(function(){
       	//getbalance();
       	getalipayaccount();
    })
       //获取当前账户的支付宝账号
  	function getalipayaccount(){
  		$.ajax({
  			type:'post',
  			url:"${pageContext.request.contextPath}/Main/myinfo/getAlipayaccount.action",
  			async: true,
  			success:function(data){
  				if(data.code==100){
  					$("#alipayaccount").html(NullCheck1(data.alipayaccount));
  					$("#alipayname").html(NullCheck2(data.alipayname));
  				}else{
  					$.alert(data.msg);
  				}
  			},
  			error:function(request){
  				$.alert("获取支付宝账号失败！");
  			}
  		})
  	}
    function NullCheck1(data){
  		if(data==""){
  			return "当前支付宝账户为空，请及时绑定&nbsp;&nbsp;<a data-toggle='modal' href='#bundlingModal'>（点我绑定）</a>"
  		}else{
  			return "当前支付宝账户为："+data+"&nbsp;&nbsp;<a data-toggle='modal' href='#editModal'>（点我修改）</a>"
  		}
  	}
    function NullCheck2(data){
  		if(data==""){
  			return "当前支付宝账户姓名为空，请及时绑定";
  		}else{
  			return "当前支付宝姓名为："+data;
  		}
  	}
    function BalipayaccountSubmit(){
  		var alipayaccount = $("#Balipayaccount").val();
  		var alipayname = $("#Balipayname").val();
  		var modalid="bundlingModal";
  		if(alipayaccount=="" || alipayname==""){
  			$.alert("填写信息不可为空！");
  			return false;
  		}
  		$.confirm({
		    title: '提示!',
		    content: '是否绑定该支付宝账号？',
		    type: 'blue',
		    typeAnimated: true,
		    buttons: {
		    	确定: function () {
		    		$("#bundlingModalBtn").html('<i class="fa fa-spinner fa-spin"></i>处理中...');
		    		$("#bundlingModalBtn").prop('disabled',true);
		    		//向服务器发送医院确认订单操作！
		        	ajaxalipaySubmit(alipayaccount,alipayname,modalid);
		    	},
				取消: function () {$('#bundlingModal').modal('hide');},
		    }	
		});
  	}
  	function EalipayaccountSubmit(){
  		var alipayaccount = $("#Ealipayaccount").val();
  		var alipayname = $("#Ealipayname").val();
  		var modalid="editModal";
  		if(alipayaccount=="" || alipayname==""){
  			$.alert("填写信息不可为空！");
  			return false;
  		}
  		$.confirm({
		    title: '提示!',
		    content: '是否修改为该支付宝账号？',
		    type: 'blue',
		    typeAnimated: true,
		    buttons: {
		    	确定: function () {
		    		$("#editModalBtn").html('<i class="fa fa-spinner fa-spin"></i>处理中...');
		    		$("#editModalBtn").prop('disabled',true);
		    		//向服务器发送医院确认订单操作！
		        	ajaxalipaySubmit(alipayaccount,alipayname,modalid);
		    	},
				取消: function () {$('#editModal').modal('hide');},
		    }	
		});
  	}
  	function ajaxalipaySubmit(alipayaccount,alipayname,modalid){
  		$.ajax({
    		type:"post",
    		url:"${pageContext.request.contextPath}/Main/myinfo/Updatealipayaccount.action",
    		async: true,
            data:"alipayaccount="+alipayaccount+"&alipayname="+alipayname,
           	success:function(data){
           		$("#"+modalid+"Btn").html('提交');
	    		$("#"+modalid+"Btn").prop('disabled',false);
           		$.alert(data.msg);
           		if(data.code==100){
           			loadingaccount(alipayaccount,alipayname);
           			$("#"+modalid).modal("hide");
           		}
           	},error:function(request){
           		$.alert("请求出错了！");
           		$("#"+modalid+"Btn").html('提交');
	    		$("#"+modalid+"Btn").prop('disabled',false);
           	}
    	})
  	}
  	function loadingaccount(alipayaccount,alipayname){
  		$("#alipayaccount").html(NullCheck1(alipayaccount));
  		$("#alipayname").html(NullCheck2(alipayname));
  	}
    </script>
</body>
</html>